package com.ssm.service.impl;

import com.ssm.base.exception.BusinessException;
import com.ssm.dao.TestDao;
import com.ssm.dao.TestDao2;
import com.ssm.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/6/29.
 */
@Transactional
@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private TestDao testDao;
    @Autowired
    private TestDao2 testDao2;
    @Override
    public List<Map<String, Object>> findAll() {

        return null;
        //return testDao.insertAll(null);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
    @Override

    public Integer addAll(Object object) throws Exception {
        //testDao.insertAll(object);
        //return 1;
        //throw new  Exception ("ddfas"){};
        //testDao2.insertAll2(object);
        return  1;
        //throw new BusinessException(-10,"二次修改失败!");
        //throw null;
    }


}
